﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Windows.Forms;
using System.Data;

namespace deneme
{
    class ClassFindData
    {

        SqlConnection con = new SqlConnection(ClassSqlConnection.ConnectionString);

        public void arama(String TabloAdi, DataGridView DataGridViewAdi, String sutunAdi, TextBox txtName)  //aramak için method
        {

            SqlCommand cmd = new SqlCommand();
            con.Open();
            DataTable dt = new DataTable();
            SqlDataAdapter da = new SqlDataAdapter("SELECT * FROM " + TabloAdi + " WHERE " + sutunAdi + " LIKE '%" + txtName.Text + "%'", con);
            da.Fill(dt);
            DataGridViewAdi.DataSource = dt;
            con.Close();
        }













    }
}
